package org.helios.gwt.remote.client;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * Utility interface for "importing" an implementation of T.
 * Use this way:
 * <pre>
 * interface ConcreteImporter extends Importer&lt;ConcreteInterface&gt; {}
 * ...
 * ConcreteImporter i = GWT.create(ConcreteImporter);
 * // obtain a JavaScriptObject from "outside" that you know has ConcreteInterface's methods
 * // (tip: it could be an exported object from other gwt-module)
 * ConcreteInterface remote = e.use(jso);
 * // now you can invoke remote.method1(); and it will work
 * </pre>
 * @param <T> interface that will be exported to "open" javascript
 */

public interface Importer<T> 
{
	T use(JavaScriptObject obj);
}
